#set(seoTitle="月报")
#@layout()
#define js()

#end
#define content()
<div id="dialog" class="easyui-dialog" title="下载报表" style="width:600px;height:200px;padding:20px;" closed="false" buttons="#dlg-buttons">
    <form id="fm" method="post" novalidate action="#" enctype="application/x-www-form-urlencoded">
        <div class="fitem">
            <label>统计时间：</label>
           <select name="year">
                <option value="2017">2017</option>
                 <option value="2018">2018</option>
                  <option value="2019">2019</option>
                   <option value="2020">2020</option>
           </select> 年
                              
           
           <select name="month">
                <option value="1">1</option>
                 <option value="2">2</option>
                  <option value="3">3</option>
                   <option value="4">4</option>
                    <option value="5">5</option>
                     <option value="6">6</option>
                      <option value="7">7</option>
                       <option value="8">8</option>
                        <option value="9">9</option>
                         <option value="10">10</option>
                          <option value="11">11</option>
                           <option value="12">12</option>
           </select>月
        </div>
         
    </form>
</div>
<div id="dlg-buttons">
    <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="post()">提交</a>
    <a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dialog').dialog('close')">取消</a>
</div>

<script>
function post(){
    var submit_url = "produceReport";
    //提交表单
    $('#fm').form('submit',{
        url: submit_url,
        onSubmit: function(){
            return $(this).form('validate');
        },
        success: function(result){
        	
            var result = eval('('+result+')');
            if (result.code == "00"){
            	
            	
                $.messager.alert("报表生成","点击确定按钮下载","info",function(){
                	
                	var downloadUrl="/download/?fileName="+result.data; 
                	window.location.href=downloadUrl;
                	
                });
               
            }else{
                $.messager.alert('出错啦',result.message);
            }
        }
    });
}  

</script>
#end